/*
package com.example.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.example.entity.Userlogin;
import com.example.mapper.UserMapper;
import com.example.service.IUserservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, Userlogin> implements IUserservice {

    private UserMapper userMapper;
    @Autowired
    public UserServiceImpl(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @Override
    public Page<Userlogin> page(Integer current, Integer size, String user_id) {
        LambdaQueryWrapper<Userlogin> wrapper = new LambdaQueryWrapper<>();
        if (user_id != null && !user_id.isEmpty()){
            //精准查询
           // wrapper.eq(Userlogin::getUser_id, user_id);
            //模糊查询
            wrapper.like(Userlogin::getUser_id, user_id);

        }
        Page<Userlogin> page = new Page <>(current, size);
        return page(page,wrapper);
    }

    @Override
    public boolean saveOrUpdateById(Userlogin userlogin) {
        if (userlogin.getUser_no() != null) {
            return updateById(userlogin);
        } else {
            return save(userlogin);
        }
    }

    @Override
    public boolean deleteBatchIds(List<Integer> user_ids) {
        return deleteBatchIds(user_ids);
    }
}
*/
